import { hilog } from '@kit.PerformanceAnalysisKit'
import { display } from '@kit.ArkUI'

export function printTsLog(log: string, tag: string = 'fkj'){

  try{

    hilog.debug(0x0012, tag, log)

  }catch(err){

    printTsLog(JSON.stringify(err), 'ERROR')

  }

}

export async function getScreenTsSize(callback: (screenWidth: number, screenHeight: number) => void): Promise<void>{

  try{

    let screenDisplay: display.Display = await display.getDefaultDisplaySync()

    if(screenDisplay){

      callback(screenDisplay.width, screenDisplay.height)

    }

  } catch (err) {

    printTsLog(JSON.stringify(err), 'getScreenSize')
  }

}